<?php

class ContactInformation
{
    var $OfficePhone;
    var $Fax;
    var $Email;
    var $URL;
	
	function PrintElement()
	{
	    echo $this->OfficePhone;
	    echo $this->Fax;
	    echo $this->Email;
	    echo $this->URL;
		echo "<br/>";
	}
	function AddItemFromXML( $xmlFormat )
	{
		$Array = $xmlFormat->children();
		$this->OfficePhone = $Array[0];
		$this->Fax = $Array[1];
		$this->Email = $Array[2];
		$this->URL = $Array[3];
	}
}

class Office
{
	var $Name;
	var $ContactInfo;
	var $Address;
	var $OfficeID;
	var $BrokerID;
	var $NRDSOfficeID;
	var $ModifyTime;
	
	function PrintElement()
	{
		echo $this->Name . "<br/>";
		$this->ContactInfo->PrintElement();
		echo $this->Address . "<br/>";
		echo $this->OfficeID . "<br/>";
		echo $this->BrokerID . "<br/>";
		echo $this->NRDSOfficeID . "<br/>";
		echo $this->ModifyTime . "<br/>";
    }
	
	function AddItemFromXML($XmlArray)
	{
		$Array = $XmlArray->children();
			
		$this->Name = $Array[0];
				
		$this->ContactInfo = new ContactInformation;
		$this->ContactInfo->AddItemFromXML($Array[1]);
	
		$Addr = $Array[2]->children();
		$this->Address = $Addr[0];
	
		$this->OfficeID = $Array[4];
	
		$this->BrokerID = $Array[5];
	
		$this->NRDSOfficeID = $Array[6];
	
		$this->ModifyTime = $Array[7];
	}
}
?>